import request from '@/utils/request'
// 获取省市区信息
export function getCountry(data) {
  return request({
    url: '/trafficfly-manager/api/addressCode/get',
    method: 'post',
    data
  })
}
// 获取省
export function getProvince(data) {
  return request({
    url: '/trafficfly-manager/shop/province/list',
    method: 'post',
    data
  })
}
// 获取市
export function getCity(data) {
  return request({
    url: '/trafficfly-manager/shop/city/list',
    method: 'post',
    data
  })
}

// 获取角色的省市
export function getRolesAddress(params) {
  return request({
    url: '/trafficfly-manager/api/roles/managerCity',
    method: 'post',
    headers: {
      'Concenter-Type': 'application/json'
    },
    params
  })
}

// 获取所有的省市
export function getRolesAddressInit(params) {
  return request({
    url: '/trafficfly-manager/api/roles/managerCityInit',
    method: 'post',
    headers: {
      'Concenter-Type': 'application/json'
    },
    params
  })
}

// 获取区
export function getDistrict(data) {
  return request({
    url: '/trafficfly-manager/shop/district/list',
    method: 'post',
    data
  })
}

// 用户登录管理后台
export function login(data) {
  return request({
    url: 'trafficfly-manager/auth/login',
    method: 'post',
    data
  })
}
// 用户登录管理后台后获取菜单列表
export function getInfo(token) {
  return request({
    url: '/menu/myMenuList',
    method: 'get'
  })
}
// 用户登出管理后台
export function logout() {
  return request({
    url: 'trafficfly-manager/auth/logout',
    method: 'delete'
  })
}
// 用户修改管理后台登录密码
export function changePwd(data) {
  return request({
    url: '/v2/supplier/user/update/pwd',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    showError: true
  })
}
// code获取省市县
export function getByAmapCode(params) {
  return request({
    url: '/trafficfly-manager/api/address/getByAmapCode',
    method: 'get',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}
